import axios from 'axios'
const devUrl = '/api'
const request =axios.create({
    baseURL : devUrl
})
request.interceptors.request.use(function (config) {
    if(config.method === "post"){
      config.data = {...config.data, headers:{'Content-Type':'application/x-www-form-urlencoded'},}
    }
    return config;
  }, function (error) {
    // 对请求错误做些什么
    return Promise.reject(error);
  });
export default request